Base class for all complex effects in the component. More...
Public Member Functions | |
ComplexEffect (nkMemory::StringView name) | |
virtual | ~ComplexEffect () |
nkMemory::StringView | getName () const |
nkGraphics::CompositorNode * | getCompositorNode () const |
virtual COMPLEX_EFFECT_TYPE | getType () const =0 |
void | setName (const nkMemory::StringView &value) |
void | setCompositorNode (nkGraphics::CompositorNode *value) |
virtual bool | load ()=0 |
virtual void | unload ()=0 |
Base class for all complex effects in the component.
This class offers basic information and the general interface to access them. Complex effects are like Effect instances, with the difference that they require a more complex rendering logic. This can include multi-pass rendering or custom CPU logic needed before each frame.
As such, ComplexEffects are designed to be used within nkGraphics::CompositorNode instances where they will be able to append multiple operations.
nkAstraeus::ComplexEffect::ComplexEffect | ( | nkMemory::StringView | name | ) |
Constructor. See ComplexEffectManager::createOrRetrieve().
name | The name of the effect. |
|
virtual |
Destructor.
nkMemory::StringView nkAstraeus::ComplexEffect::getName | ( | ) | const |
nkGraphics::CompositorNode* nkAstraeus::ComplexEffect::getCompositorNode | ( | ) | const |
|
pure virtual |
Implemented in nkAstraeus::DofComplexEffect, and nkAstraeus::BlurComplexEffect.
void nkAstraeus::ComplexEffect::setName | ( | const nkMemory::StringView & | value | ) |
Sets the name of the effect.
value | The name to set. |
void nkAstraeus::ComplexEffect::setCompositorNode | ( | nkGraphics::CompositorNode * | value | ) |
Sets the node in which the effect should add its required rendering steps. Typically, a CompositorNode can be allocated within the Compositor where needed, and passed to the effect for it to populate it.
value | The node the effect has to work in. |
|
pure virtual |
Loads the effect and make it ready for rendering. After a successful call, this means the compositor node will be populated with the relevant data.
Implemented in nkAstraeus::DofComplexEffect, and nkAstraeus::BlurComplexEffect.
|
pure virtual |
Unloads the effect and its internal memory. After that, the effect is unusable for rendering. The compositor node specified will be cleaned from all linked operations.
Implemented in nkAstraeus::DofComplexEffect, and nkAstraeus::BlurComplexEffect.